<?php
declare (strict_types=1);

namespace app\admin\model\store;

use app\admin\model\order\Order;
use app\admin\model\user\User;
use think\Model;

/**
 * @mixin \think\Model
 */
class Pink extends Model
{
    public static function getPink()
    {
        $felid = [
            'id','user_id','order_id','pink_id',
            'is_master','pink_no','goods_sku_id',
            'open_time','status','in_people','stop_time'
        ];
        return self::field($felid);
    }

    public function  user()
    {
        return $this->belongsTo(User::class,'user_id','id')->bind(['avatar','nickname']);
    }

    public function  order()
    {
        return $this->belongsTo(Order::class,'order_id','id');
    }

    public function  pinkConfig()
    {
        return $this->belongsTo(PinkConfig::class,'pink_id','id')->bind(['goods_img','pink_people','pink_time','end_time','start_time']);
    }

    public function  goodsSkuId()
    {
        return $this->belongsTo(GoodsSku::class,'goods_sku_id','id');
    }


}
